const express = require('express');
const router = express.Router();
const { pool } = require('../config/database');

// Get user profile
router.get('/profile', async (req, res) => {
  try {
    res.json({
      success: true,
      data: {
        id: 1,
        name: 'Test User',
        phone: '12345678901',
        email: 'test@example.com'
      }
    });
  } catch (error) {
    console.error('Get profile error:', error);
    res.status(500).json({
      success: false,
      message: 'Failed to get user profile'
    });
  }
});

// Update user profile
router.put('/profile', async (req, res) => {
  try {
    const { name, email } = req.body;
    
    res.json({
      success: true,
      message: 'Profile updated successfully',
      data: { name, email }
    });
  } catch (error) {
    console.error('Update profile error:', error);
    res.status(500).json({
      success: false,
      message: 'Failed to update profile'
    });
  }
});

module.exports = router;